package cn.lds.healthexamspringboot.controller;

import cn.lds.healthexamspringboot.domain.HealthExamItem;
import cn.lds.healthexamspringboot.domain.HealthExamPackage;
import cn.lds.healthexamspringboot.dto.ResponseDTO;
import cn.lds.healthexamspringboot.service.HealthExamItemService;
import cn.lds.healthexamspringboot.service.HealthExamPackageService;
import cn.lds.healthexamspringboot.service.impl.HealthExamItemServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("items")
public class HealthExamItemController {

    @Resource
    private HealthExamItemService healthExamItemService;

    @Autowired
    private HealthExamPackageService healthExamPackageService;

    @GetMapping("show_pack_id")
    public String showItem(Model model,Integer id){

        //ResponseDTO<List<HealthExamItem>> listResponseDTO = healthExamItemService.selectItemAll();

        ResponseDTO<HealthExamPackage> healthExamPackageResponseDTO = healthExamPackageService.selectHealthExamPackageById(id);

        model.addAttribute("result",healthExamPackageResponseDTO);


        return "show_pack_one";
    }
}
